home *** CD-ROM | disk | FTP | other *** search
- package
- {
- import flash.utils.Dictionary;
-
- public class Partner
- {
-
-
- internal var _aLikeTexts:Array;
-
- public var TargetName:String = "";
-
- public var AttributeMatchMinimum:int = 3;
-
- public var ImageName:String = "";
-
- public var Name:String = "";
-
- public var Index:int;
-
- public var HintText:String = "";
-
- public var Attributes:Array;
-
- public var TargetModel:String = "";
-
- public function Partner()
- {
- Name = "";
- HintText = "";
- Attributes = new Array();
- ImageName = "";
- TargetModel = "";
- TargetName = "";
- AttributeMatchMinimum = 3;
- _aLikeTexts = new Array();
- super();
- }
-
- public function getLikeTextForIndex(param1:int) : String
- {
- return _aLikeTexts[param1] as String;
- }
-
- public function isSkipAttribute(param1:String) : Boolean
- {
- if(param1 == "long" || param1 == "medium" || param1 == "short")
- {
- return true;
- }
- return false;
- }
-
- public function getLikeText() : String
- {
- var _loc1_:int = 0;
- _loc1_ = Math.random() * _aLikeTexts.length;
- trace("Like text " + _loc1_.toString() + " of " + _aLikeTexts.length);
- return _aLikeTexts[_loc1_] as String;
- }
-
- public function getNumLikeTexts() : int
- {
- return _aLikeTexts.length;
- }
-
- public function addLikeText(param1:String) : void
- {
- _aLikeTexts.push(param1);
- }
-
- public function likesList(param1:DressupModel) : Array
- {
- var _loc2_:Array = null;
- var _loc3_:Dictionary = null;
- var _loc4_:String = null;
- var _loc5_:Part = null;
- var _loc6_:String = null;
- _loc2_ = new Array();
- _loc3_ = new Dictionary();
- for each(_loc4_ in ["top","bottom","shoe"])
- {
- if((_loc5_ = param1.getPart(_loc4_)) != null)
- {
- for each(_loc6_ in Attributes)
- {
- if(_loc5_.Template.hasAttribute(_loc6_))
- {
- if(!(_loc4_ == "shoe" && isSkipAttribute(_loc6_)))
- {
- _loc3_[_loc6_] = _loc6_;
- }
- }
- }
- }
- }
- for each(_loc6_ in _loc3_)
- {
- _loc2_.push(_loc6_);
- }
- return _loc2_;
- }
-
- public function likes(param1:DressupModel) : Boolean
- {
- var _loc2_:int = 0;
- var _loc3_:String = null;
- var _loc4_:Part = null;
- var _loc5_:String = null;
- _loc2_ = 0;
- for each(_loc3_ in ["top","bottom"])
- {
- if((_loc4_ = param1.getPart("top")) == null)
- {
- return false;
- }
- for each(_loc5_ in Attributes)
- {
- if(_loc4_.Template.hasAttribute(_loc5_))
- {
- _loc2_++;
- }
- }
- if(_loc2_ < AttributeMatchMinimum)
- {
- return false;
- }
- }
- return true;
- }
- }
- }
-